<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>供应链角色管理</title>
<link href="${BasePath}/res/css/common/liger-hack.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<script type="text/javascript" src="${BasePath}/res/js/role/role.js"></script>
<style type="text/css">
#searchbar{
	margin-bottom: 10px;
}
.navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.s-button {
	width:50px; margin-left:10px; padding-bottom:2px;
}
</style>
</head>
<body style="padding:6px; overflow:hidden;">
<div id="">
	<div class="navbar"><span>您当前的位置： 系统管理 &gt; 供应链角色管理</span></div>
	<br/>
	<form action="#"  name="queryForm" id="queryForm" method="POST">
		角色名称：<input type="text" id="roleName" name="roleName" size="30" maxLength="40" value="${roleVo.roleName }">&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" value="查询" class="s-button" />
		<input id="reset" type="button" value="重置" class="s-button" />
	</form>
	<br/>
</div>
<div id="maingrid6" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
<script type="text/javascript">
    var grid = null;
    $(function () {
        grid = $("#maingrid6").ligerGrid({
            columns: [
            { display: '角色名称', name: 'roleName', align: 'left'},
            { display: '角色编码', name: 'roleCode'},
            { display: '角色类型', name: 'roleType', render: function(rowdata, rowindex, value) {
            	if (rowdata.roleType == 1) {
            		return "供应链平台角色";
            	} else if (rowdata.roleType == 2) {
            		return "供应商开放平台角色";
            	} else {
            		return "";
            	}
            } },
            { display: '备注', name: 'remark', align: 'left' },
            { display: '操作', isSort: false, render: function (rowdata, rowindex, value){
                    var h = "";
                   	h += "<a href='javascript:toModifyRole(" + rowindex + ")'>修改</a> ";
                    h += "<a href='javascript:deleteRole(" + rowindex + ")'>删除</a> ";
                    h += "<a href='javascript:toAllocateAccess(" + rowindex + ")'>分配权限</a> ";
                    return h;
                }
            }
            ], 
            pageSize:30,
            width: '100%',
            height: '100%',
            dataType: 'server', 
            dataAction: 'server',
            pagesizeParmName: 'pageSize',
            parms: [
                    {name: "roleName", value:$("#roleName").val()},
            	],
            url: "ajaxToRoleList.do",
            toolbar: { items: [
                              	{ text: "新  增", click: toAddRole, icon: "add"}
                              ]}
        });
        
        $("#reset").click(function() {    
        	$('input[type="text"]').val("");
    	});   
    });
</script>
</body>
</html>